﻿Imports capaNegocios

Public Class secCurso_agregar
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnAgregarCurso_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAgregarCurso.Click
        Dim objCurso As New clsCurso
        objCurso.nombre = Me.txtCursoAgregar.Text
        objCurso.horasTeoricas = Me.ddlHoraTeoricaAgregar.SelectedItem.ToString
        objCurso.horasPracticas = Me.ddlHoraPracticaAgregar.SelectedItem.ToString
        objCurso.descripcion = Me.txtDescripcionAgregar.Text

        If objCurso.Agregar() = True Then
            MsgBox("Curso agregado con éxito.")
            Response.Redirect("secCurso.aspx")
        Else
            MsgBox("Error al agregar curso.")
        End If
    End Sub
End Class